import { Controller, Get, Req, UseGuards } from '@nestjs/common';
import { AppService } from './app.service';
import { ApiBearerAuth, ApiExcludeController } from "@nestjs/swagger"
import { LoginGuard } from './login.guard';

// @ApiExcludeController()
@Controller()
export class AppController {
  constructor(private readonly appService: AppService) {}

  @Get()
  getHello(): string {
    return this.appService.getHello();
  }

  @Get('aaa')
  @ApiBearerAuth()
  @UseGuards(LoginGuard)
  aaa(@Req() request:Request){
    const user = (request as any).user;
    return user;
  }

  @Get('bbb')
  bbb(){
    return 'bbb'
  }

}
